extends Camera2D

var cam_move_right = false
var cam_move_left = false
var cam_move_up = false
var cam_move_down = false



func _process(delta: float) -> void:
	if get_local_mouse_position().x > 540:
		cam_move_right = true
		cam_move_left = false
	if get_local_mouse_position().x < -540:
		cam_move_right = false
		cam_move_left = true
	if get_local_mouse_position().x > -540 and get_local_mouse_position().x < 540:
		cam_move_right = false
		cam_move_left = false
	
	if get_local_mouse_position().y > 280:
		cam_move_up = false
		cam_move_down = true
	if get_local_mouse_position().y < -280:
		cam_move_up = true
		cam_move_down = false
	if get_local_mouse_position().y > -280 and get_local_mouse_position().y < 280:
		cam_move_up = false
		cam_move_down = false
	
	if cam_move_right==true and position.x<2040:
		position += Vector2.RIGHT *6
		$"../UI/MiniMap/screen".position += Vector2.RIGHT*0.4
		
	if cam_move_left==true and position.x>-870:
		position += Vector2.LEFT *6
		$"../UI/MiniMap/screen".position += Vector2.LEFT*0.4
	
	if cam_move_up==true and position.y>-1060:
		position += Vector2.UP *6
		$"../UI/MiniMap/screen".position += Vector2.UP*0.4
	
	if cam_move_down==true and position.y<1700:
		position += Vector2.DOWN *6
		$"../UI/MiniMap/screen".position += Vector2.DOWN*0.4
	
	
	
